from asdg import outer
def outer(func):
    def inner(self,a,b):
        print(f"调用方法:{func.__name__},参数:{a}，{b}")
        result = func(self,a,b)
        if result is not None:
            print(f"运算结果:{result}")
        print("_"* 30)
        return result
    return inner
class DoyunSuan():
    num = 100
    @outer
    def add(self,a, b):
        return a + b
    @outer
    def minus(self,a, b):
        return a - b

    @outer
    def mul(self,a, b):
        return a * b

    @outer
    def div(self,a, b):
        try:
            c = a / b
            print("未发生异常")
            return c
        except ZeroDivisionError:
            print("发生异常，除数不能为0")
        except Exception as e:
            print(f"发生异常，异常是{e}")
        finally:
            print("未发生异常，运算结束")

if __name__ == '__main__':
    ys=DoyunSuan()
    ys.add(20,90)
    ys.mul(20,90)
    ys.minus(20,90)
    ys.div(20,90)
    ys.div(4,0)
    ys.div("23",35)


